using System;
using System.Data;
using System.Collections.Generic;

namespace SERP.DAO{
	/********************************BEGIN SalaryDataDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:09/03/2013 19:09:04</para>
	/// <para>Class Name: SalaryDataDAO</para>
	/// <para>Description: Class access to table SalaryData in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class SalaryDataDAO : DAOBase<SalaryDataEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: SalaryDataId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int SalaryDataId){
			string strSQL="SELECT  [SalaryDataId],[SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId] FROM [SalaryData]  WHERE [SalaryData].[SalaryDataId]=@SalaryDataId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryDataId",SalaryDataId);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: SalaryDataId</para>
		/// <para>Output: SalaryDataEntity</para>
		///</summary>
		public SalaryDataEntity SelectOne(int SalaryDataId){
			IDbCommand cmd=this.CreateSelectOneCommand(SalaryDataId);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [SalaryDataId],[SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId] FROM [SalaryData] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [SalaryDataId],[SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId] FROM [SalaryData]  WHERE [SalaryData].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SalaryDataEntity</para>
		///</summary>
		public List<SalaryDataEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [SalaryDataId],[SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId] FROM [SalaryData]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [SalaryDataId],[SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId] FROM [SalaryData]  WHERE [SalaryData].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SalaryDataEntity</para>
		///</summary>
		public List<SalaryDataEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(SalaryDataEntity o){
			string strSQL="INSERT INTO [SalaryData]([SalaryFieldId],[PersonId],[Salary],[YearOfSalary],[MonthOfSalary],[UserId]) VALUES  (@SalaryFieldId,@PersonId,@Salary,@YearOfSalary,@MonthOfSalary,@UserId);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryFieldId)
				this.CreateCommandParameter(cmd,"@SalaryFieldId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryFieldId",o.SalaryFieldId);

			if(o.IsNullPersonId)
				this.CreateCommandParameter(cmd,"@PersonId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@PersonId",o.PersonId);

			if(o.IsNullSalary)
				this.CreateCommandParameter(cmd,"@Salary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Salary",o.Salary);

			if(o.IsNullYearOfSalary)
				this.CreateCommandParameter(cmd,"@YearOfSalary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@YearOfSalary",o.YearOfSalary);

			if(o.IsNullMonthOfSalary)
				this.CreateCommandParameter(cmd,"@MonthOfSalary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MonthOfSalary",o.MonthOfSalary);

			if(o.IsNullUserId)
				this.CreateCommandParameter(cmd,"@UserId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@UserId",o.UserId);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Save</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(SalaryDataEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.SalaryDataId=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of SalaryDataEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<SalaryDataEntity>list){
			foreach(SalaryDataEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(SalaryDataEntity o){
			string strSQL="UPDATE  [SalaryData] SET [SalaryData].[SalaryFieldId]=@SalaryFieldId,[SalaryData].[PersonId]=@PersonId,[SalaryData].[Salary]=@Salary,[SalaryData].[YearOfSalary]=@YearOfSalary,[SalaryData].[MonthOfSalary]=@MonthOfSalary,[SalaryData].[UserId]=@UserId WHERE [SalaryData].[SalaryDataId]=@SalaryDataId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryFieldId)
				this.CreateCommandParameter(cmd,"@SalaryFieldId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryFieldId",o.SalaryFieldId);

			if(o.IsNullPersonId)
				this.CreateCommandParameter(cmd,"@PersonId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@PersonId",o.PersonId);

			if(o.IsNullSalary)
				this.CreateCommandParameter(cmd,"@Salary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Salary",o.Salary);

			if(o.IsNullYearOfSalary)
				this.CreateCommandParameter(cmd,"@YearOfSalary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@YearOfSalary",o.YearOfSalary);

			if(o.IsNullMonthOfSalary)
				this.CreateCommandParameter(cmd,"@MonthOfSalary",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MonthOfSalary",o.MonthOfSalary);

			if(o.IsNullUserId)
				this.CreateCommandParameter(cmd,"@UserId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@UserId",o.UserId);

			if(o.IsNullSalaryDataId)
				this.CreateCommandParameter(cmd,"@SalaryDataId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryDataId",o.SalaryDataId);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,SalaryDataId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int SalaryDataId){
			string strSQL="UPDATE  [SalaryData] SET [SalaryData].["+ColumnName+"]=@ColumnName WHERE [SalaryData].[SalaryDataId]=@SalaryDataId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryDataId",SalaryDataId);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Update</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(SalaryDataEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of SalaryDataEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<SalaryDataEntity>list){
			foreach(SalaryDataEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateSalaryFieldId</para>
		/// <para>Input: NewSalaryFieldId,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSalaryFieldId(int NewSalaryFieldId,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SalaryFieldId",NewSalaryFieldId,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdatePersonId</para>
		/// <para>Input: NewPersonId,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdatePersonId(int NewPersonId,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("PersonId",NewPersonId,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateSalary</para>
		/// <para>Input: NewSalary,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSalary(Decimal NewSalary,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Salary",NewSalary,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateYearOfSalary</para>
		/// <para>Input: NewYearOfSalary,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateYearOfSalary(int NewYearOfSalary,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("YearOfSalary",NewYearOfSalary,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateMonthOfSalary</para>
		/// <para>Input: NewMonthOfSalary,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMonthOfSalary(int NewMonthOfSalary,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MonthOfSalary",NewMonthOfSalary,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateUserId</para>
		/// <para>Input: NewUserId,SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateUserId(int NewUserId,int SalaryDataId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("UserId",NewUserId,SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [SalaryData]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(SalaryDataEntity o){
			string strSQL="DELETE   FROM [SalaryData]   WHERE [SalaryData].[SalaryDataId]=@SalaryDataId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryDataId)
				this.CreateCommandParameter(cmd,"@SalaryDataId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryDataId",o.SalaryDataId);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: SalaryDataId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int SalaryDataId){
			string strSQL="DELETE   FROM [SalaryData]   WHERE [SalaryData].[SalaryDataId]=@SalaryDataId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryDataId",SalaryDataId);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [SalaryData]   WHERE [SalaryData].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Delete</para>
		/// <para>Input: SalaryDataEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(SalaryDataEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: SalaryDataId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int SalaryDataId){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(SalaryDataId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to PeopleSalaryFields functions
		#endregion

		#region Select join to People functions
		#endregion

		#region Select join to SalaryFields functions
		#endregion

		#region Select,delete by SalaryDataId functions
		#endregion

		#region Select,delete by SalaryFieldId functions
		#endregion

		#region Select,delete by PersonId functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: SalaryDataEntity</para>
		///</summary>
		protected override SalaryDataEntity MapObject(IDataReader r){
			SalaryDataEntity entity = new SalaryDataEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("SalaryDataId");
						if (!r.IsDBNull(ordinal)) entity.SalaryDataId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SalaryFieldId");
						if (!r.IsDBNull(ordinal)) entity.SalaryFieldId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("PersonId");
						if (!r.IsDBNull(ordinal)) entity.PersonId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Salary");
						if (!r.IsDBNull(ordinal)) entity.Salary = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("YearOfSalary");
						if (!r.IsDBNull(ordinal)) entity.YearOfSalary = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MonthOfSalary");
						if (!r.IsDBNull(ordinal)) entity.MonthOfSalary = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("UserId");
						if (!r.IsDBNull(ordinal)) entity.UserId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END SalaryDataDAOBase*****************************************/
	/*****************************************************************************************************/
}

